<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>闲言轻博客</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" th:href="@{/layui/css/layui.css}">
	<link rel="stylesheet" th:href="@{/css/mian.css}">
</head>
<body class="lay-blog">
		<!--引入header-->
		<div th:replace="/include/header::header"></div>
		<div class="container-wrap">
			<div class="container">
					<div class="contar-wrap">
						<!--公告-->
						<div th:replace="/include/speaker::speaker"></div>
						<!---->

						<div th:if="${listState} eq true">
							<h1>换个姿势 再来一次！</h1>
						</div>
						<div class="item" th:each="art:${page.list}">
						<!--转载start-->
						<div class="crea_tag">
								<div class="shadowtag shadow_blue" th:if="${art.original} eq false">
								原创
									<div class="cornertag corner_blue" ></div>
								</div>
							<div class="shadowtag shadow_red" th:if="${art.original} eq true">
								转载
							<div class="cornertag corner_red"></div>
							</div>
						</div>
						<!--转载结束--->
						<!--time 时间-->
							<div class="article_time">
								<span class="article_time_info" th:text="${#dates.format(art.createTime, 'yyyy-MM-dd')}"></span>
								<br/>
								<span class="article_time_info" th:text="${art.dayName}"></span>
								<i></i>
							</div>
						<!--time 开始-->
						<!--article 测试 （有图片版本的）-->
							<div class="item-box  layer-photos-demo1 layer-photos-demo index_item_box">
								<h3 class="article_title"><a th:href="@{'/index/'+${art.id}}" th:text="${art.title}"></a></h3>
								<h2 class="artcle_h2_zhaiyao">文章摘要</h2>
								<p class="item-box-des des_img" th:if="${art.isCoverImage} eq true" th:text="${art.description}"></p>
								<img th:src="@{/images/item.png}" th:if="${art.isCoverImage} eq true" alt="" class="layui-anim layui-anim-scaleSpring des_img_i">
								<p class="item-box-des" th:if="${art.isCoverImage} eq false" th:text="${art.description}"></p>
							</div>
							<div class="article_footer">
									<div class="article_footer">
										<span><i class="layui-icon" style="color: #1E9FFF;">&#xe66f;</i> <user th:text="${art.user.username}"></user></span>
										<span><i class="layui-icon"  style="color:#FFB800;">&#xe656;</i> <type th:text="${art.type.name}"></type></span>
										<span><i class="layui-icon">&#xe66e;</i> <tag th:each="tag:${art.tags}"><i th:text="${tag.name}"></i></tag></span>
										<span><i class="layui-icon">&#xe674;</i> 浏览(<i style="color:#096;"><look th:text="${art.lookNum}"></look></i>)</span>
										<span class="readall pull-right"><i class="readall_i layui-icon">&#xe705;</i><a  th:href="@{'/index/'+${art.id}}">阅读原文</a></span>
									</div>
							</div>
						</div>
						<!--End-->
					</div>


					<div class="item-btn">
						<a class="layui-btn layui-btn-normal" onclick="next()"  th:if="${page.isLastPage} eq false">下一页</a>
						<button class="layui-btn layui-btn-normal"  th:if="${page.isLastPage} eq true">已经是最后一页了，别点了！</button>
						<a class="layui-btn layui-btn-normal" th:href="@{/index(pageNum=0)}" th:if="${page.isLastPage} eq true">返回首页</a>
					</div>



			</div>
			<div class="container_right">
				<!-- 自我介紹-->
				<div th:replace="/include/Mydes::Mydes"></div>
				<!-- 自我介紹-->
				<!--tag -->
				<div th:replace="/include/tag::tag"></div>
				<!--tag -->
				<!--文章列表分类-->
				<div th:replace="/include/typeTab::typeTab"></div>
				<!--文章列表分类-->
			</div>
	</div>
		<!--footer-->
			<div th:replace="/include/footer::footer"></div>
		<!--footer-->
	<script th:src="@{/layui/layui.js}"></script>
	<script th:src="@{/js/blog.js}"></script>
	<!--<script>-->
		<!--layui.config({-->
		  <!--base: '/js/}'-->
		<!--}).use('blog');	-->
	<!--</script>-->

		<script th:inline="javascript">
           function  next() {
               var tagId =  [[${tagId}]];
               var typeId =  [[${typeId}]];
               console.log(typeId);
               var next = [[${page.pageNum+1}]];
               if(tagId==null&&typeId==null){
                   window.location.href="/index?pageNum=[[${page.pageNum+1}]]";
               }
               if(typeId==null){
                   window.location.href="/index?pageNum=[[${page.pageNum+1}]]";
			   }
			   if(tagId==null){
                   window.location.href="/index?pageNum=[[${page.pageNum+1}]]";
			   }
			   if(tagId!=null){
                   window.location.href="/index?pageNum="+next+"&tagId="+tagId;
               }
               if(typeId!=null){
                   window.location.href="/index?pageNum="+next+"&typeId="+typeId;
			   }
			   if(tagId!=null&&typeId!=null){
                   window.location.href="/index?pageNum="+next+"&typeId="+typeId+"&tagId="+tagId;
			   }
           }

		</script>


</body>
</html>